const requireEx=require('yi-require');


module.exports = {
    description:'获取店铺商品类型tree',
    handler(req, res, next){
        req.mongo.collection("goodsType").aggregate([
            {$match: {storeId: req.query.storeId}},
            {
                $lookup:{
                    from:"goods",
                    localField:"_id",
                    foreignField:"goodsTypeId",
                    as:"goodsList"
                }
            }
        ]).toArray((err, r)=> {
            if(err) return res.err.mongoError(err);
            res.reply({code:0,message:'查询成功',data:r});
        });
    }
};
